package Test02;

public class TestComputer {

	public static void main(String[] args) {
		
		//调用电脑
		Computer computer = new Computer();
		
		computer.open();
		
		//调用打印机 
		Print p = new Print();
		//向上转型  USB usb = new Print();
		computer.inter(p);
		
		/*//调用U盘
		Flash f = new Flash();
		
		computer.inter(f);*/
		
		//也可以用匿名对象
		computer.inter(new Flash());
		
		computer.close();

	}

}
